<template>
  <el-drawer @close="close" title="项目历史记录" :visible.sync="hisDrawer" :with-header="false" size="600px">
    <div class="right-box">
      <div class="title-box flex ac fw" style="margin: 20px 0 0 10px">
        项目历史记录
      </div>
      <!-- <div class="tab-box">
        <el-tabs :value="activeName" @tab-click="tabClick">
          <el-tab-pane v-for="(item, index) in tabList" :key="item.id" :label="item.label"
            :name="item.id"></el-tab-pane>
        </el-tabs>
      </div> -->
      <el-empty style="margin-top: 150px" description="无数据" v-if="!logList.length"></el-empty>
      <el-timeline class="timeline" v-loading="logLoaidng" v-if="hisDrawer">
        <el-timeline-item v-for="(item, index) in logList" :key="index">
          <div class="setp-box">
            <div class="setp-top flex ac jb">
              <p class="time">{{ item.updated_at }}</p>
              <div class="user-box flex ac">
                <img class="avater" :src="item.handlers_image" />
                {{ item.handlers_name + "-" + item.handlers_position }}
              </div>
            </div>
            <div class="setp-content">
              <div class="title" style="font-size: 14px">
                {{
                  `${item.content}${item.state == 500 ? "（管理员回退该记录已废弃）" : ""
                  }`
                }}
              </div>
              <!-- 勘场费用信息 -->
              <template v-if="item.log_status == 140">
                <div class="content-table">
                  <div class="table-item">
                    <span class="table-item-title  history_justify_8">收款类型</span>
                    <span class="table-item-content">
                      <span>勘场费用</span>
                    </span>
                  </div>
                  <div class="table-item">
                    <span class="table-item-title  history_justify_8">收款账户</span>
                    <span class="table-item-content">{{
                      item.form_data.account_name || "--"
                    }}</span>
                  </div>
                  <div class="table-item">
                    <span class="table-item-title  history_justify_8">收款金额</span>
                    <span class="table-item-content">{{
                      item.form_data.amount_collected || "--"
                    }}</span>
                  </div>

                  <div class="table-item" v-if="item.remark">
                    <span class="table-item-title  history_justify_8">备注描述</span>
                    <span class="table-item-content">{{ item.remark }}</span>
                  </div>
                  <div class="table-item" v-if="
                    item.form_data.payment_voucher.length
                  ">
                    <span class="table-item-title  history_justify_8">收款凭证</span>
                  </div>
                  <div class="img-list-box flex ac fw">
                    <img @click="$fileViewHandle(file)" v-for="(file, fileIndex) in item.form_data
                      .payment_voucher" :key="fileIndex" class="img" :src="file.file_url" />
                  </div>
                </div>
              </template>
              <!-- 对客日志 -->
              <template v-if="item.log_status == 450">
                <div class="content-table">
                  <div class="flex jb fw">
                    <div class="table-item" style="width: 50%;">
                      <span class="table-item-title  history_justify_8">是否需要再次沟通</span>
                      <span class="table-item-content">{{
                        item.form_data.is_communicate_again == 1 ? '是' : '否'
                      }}</span>
                    </div>
                    <div class="table-item" style="width: 50%;">
                      <span class="table-item-title  history_justify_8">跟进方式</span>
                      <span class="table-item-content">
                        <template v-if="item.form_data.follow_up_method == 1">电话</template>
                        <template v-if="item.form_data.follow_up_method == 2">微信</template>
                        <template v-if="item.form_data.follow_up_method == 3">企微</template>
                        <template v-if="item.form_data.follow_up_method == 4">邮件</template>
                        <template v-if="item.form_data.follow_up_method == 5">上门拜访</template>
                      </span>
                    </div>
                    <div class="table-item" style="width: 50%;">
                      <span class="table-item-title  history_justify_8">本次沟通阶段</span>
                      <span class="table-item-content">
                        <template v-if="item.form_data.communication_stage == 1">勘场</template>
                        <template v-if="item.form_data.communication_stage == 2">报价</template>
                        <template v-if="item.form_data.communication_stage == 3">洽谈</template>
                        <template v-if="item.form_data.communication_stage == 4">签约</template>
                        <template v-if="item.form_data.communication_stage == 5">结算</template>
                        <template v-if="item.form_data.communication_stage == 6">售后</template>
                      </span>
                    </div>
                    <div class="table-item" style="width: 50%;">
                      <span class="table-item-title  history_justify_8">意向签约金额</span>
                      <span class="table-item-content">{{
                        item.form_data.intended_signing_amount ? item.form_data.intended_signing_amount + "元" : '--'
                      }}</span>
                    </div>
                    <div class="table-item">
                      <span class="table-item-title  history_justify_8">下次沟通时间</span>
                      <span class="table-item-content">{{
                        item.form_data.next_communication_time || "--"
                      }}</span>
                    </div>
                    <div class="table-item">
                      <span class="table-item-title  history_justify_8">本次沟通内容</span>
                      <span class="table-item-content">{{
                        item.form_data.content || "--"
                      }}</span>
                    </div>
                  </div>
                  <div class="table-item" v-if="
                    item.form_data.log_file.length
                  ">
                    <span class="table-item-title  history_justify_8">日志附件</span>
                  </div>
                  <div class="img-list-box flex ac fw">
                    <img @click="$fileViewHandle(file)" v-for="(file, index) in item.form_data.log_file" :key="index"
                      class="img" :src="$fileImgFunc(file)" />
                  </div>
                </div>
              </template>
              <!-- 勘场报告 -->
              <template v-if="item.log_status == 170">
                <div class="content-table">
                  <div class="table-item" v-if="
                    item.form_data.scene_file.length
                  ">
                    <span class="table-item-title  history_justify_8">现场图片</span>
                  </div>
                  <div class="img-list-box flex ac fw" v-if="
                    item.form_data.scene_file
                  ">
                    <img @click="$fileViewHandle(file)" v-for="(file, index) in item.form_data.scene_file" :key="index"
                      class="img" :src="file.file_url" />
                  </div>
                  <div class="table-item" v-if="
                   
                    item.form_data.report_file.length
                  ">
                    <span class="table-item-title  history_justify_8">勘场报告</span>
                  </div>
                  <div class="img-list-box flex ac fw" v-if="
                   
                    item.form_data.report_file.length
                  ">
                    <span v-for="(file, index) in item.form_data.report_file" :key="index"
                      @click="$fileViewHandle(file)" class="file-name">
                      {{ file.file_name }}
                    </span>
                  </div>
                  <div class="table-item" v-if="
                  
                    item.form_data.video_file.length
                  ">
                    <span class="table-item-title  history_justify_8">现场视频</span>
                  </div>
                  <div class="img-list-box flex ac fw" v-if="
                  
                    item.form_data.video_file.length
                  ">
                    <div class="img" @click="$fileViewHandle(file)" v-for="(file, index) in item.form_data.video_file"
                      :key="index">
                      <div class="play-icon">
                        <i class="el-icon-caret-right"></i>
                      </div>
                      <video :src="file.file_url"></video>
                    </div>
                  </div>
                  <div class="table-item" v-if="
                    
                    item.form_data.sketch_file.length
                  ">
                    <span class="table-item-title  history_justify_8">手绘图</span>
                  </div>
                  <div class="img-list-box flex ac fw" v-if="
                    
                    item.form_data.sketch_file.length
                  ">
                    <img @click="$fileViewHandle(file)" v-for="(file, index) in item.form_data.sketch_file" :key="index"
                      class="img" :src="file.file_url" />
                  </div>
                  <div class="table-item" v-if="item.remark">
                    <span class="table-item-title  history_justify_8">备注描述</span>
                    <span class="table-item-content">{{ item.remark }}</span>
                  </div>
                </div>
              </template>
              <!-- 上传勘场资料 -->
              <template v-if="item.log_status == 180">
                <div class="content-table">
                  <div class="table-item" v-if="
                    item.form_data.survey_data.length 
                  ">
                    <span class="table-item-title  history_justify_8">设计文件</span>
                    <template v-for="(file, index) in item.form_data.survey_data">
                      <div @click="$fileViewHandle(file)" class="file-name" :key="index">{{
                        file.file_name }}</div>
                    </template>
                  </div>
                  <div class="table-item" v-if="item.remark">
                    <span class="table-item-title  history_justify_8">备注描述</span>
                    <span class="table-item-content">{{ item.remark }}</span>
                  </div>
                </div>
              </template>
              <!-- 上传设计图 -->
              <template v-if="item.log_status == 190">
                <div class="content-table">
                  <div class="table-item">
                    <span class="table-item-title  history_justify_8">平面图</span>
                    <span v-for="(file, fileIndex) in item.form_data.plan_drawing" :key="fileIndex"
                      @click="$fileViewHandle(file)" class="file-name">
                      {{ file.file_name }}
                    </span>
                    <span class="table-item-content" v-if="!item.form_data.plan_drawing.length">--</span>
                  </div>
                  <div class="img-list-box flex ac fw">
                    <img @click="$fileViewHandle(file)" v-for="(file, index) in item.form_data.plan_drawing_image"
                      :key="index" class="img" :src="file.file_url" />
                  </div>
                  <div class="table-item">
                    <span class="table-item-title  history_justify_8">效果图</span>
                    <template>
                      <span @click="
                        $fileViewHandle(file)
                        " class="file-name" v-for="(file, fileIndex) in item.form_data.effect_drawing"
                        :key="fileIndex">
                        {{ file.file_name }}
                      </span>
                      <span class="table-item-content" v-if="!item.form_data.effect_drawing.length">--</span>
                    </template>
                  </div>
                  <div class="img-list-box flex ac fw">
                    <img @click="$fileViewHandle(file)" v-for="(file, index) in item.form_data
                      .effect_drawing_image" :key="index" class="img" :src="file.file_url" />
                  </div>
                  <div class="table-item">
                    <span class="table-item-title  history_justify_8">施工图</span>
                    <template>
                      <span @click="$fileViewHandle(file)" class="file-name"
                        v-for="(file, fileIndex) in item.form_data.construction_drawing" :key="fileIndex">
                        {{ file.file_name }}
                      </span>
                      <span class="table-item-content" v-if="!item.form_data.construction_drawing.length">--</span>
                    </template>
                  </div>
                  <div class="img-list-box flex ac fw">
                    <img @click="$fileViewHandle(file)" v-for="(file, index) in item.form_data
                      .construction_drawing_image" :key="index" class="img" :src="file.file_url" />
                  </div>
                  <div class="table-item">
                    <span class="table-item-title  history_justify_8">其他文件</span>
                    <template>
                      <template v-if="item.form_data.other_file.length">
                        <span v-for="(file, fileIndex) in item.form_data.other_file" :key="fileIndex"
                          @click="$fileViewHandle(file)" class="file-name">
                          {{ file.file_name }}
                        </span>
                      </template>
                      <span class="table-item-content" v-else>--</span>
                    </template>
                  </div>
                  <div class="table-item" v-if="item.remark">
                    <span class="table-item-title  history_justify_8">备注描述</span>
                    <span class="table-item-content">{{ item.remark }}</span>
                  </div>
                </div>
              </template>
              <!-- 提交报价申请 -->
              <template v-if="item.log_status == 200">
                <div class="content-table">
                  <div class="table-item">
                    <span class="table-item-title  history_justify_8">预计开工日期</span>
                    <span class="table-item-content">{{
                      item.form_data.start_date || "--"
                    }}</span>
                  </div>
                  <div class="table-item">
                    <span class="table-item-title  history_justify_8">预计完工日期</span>
                    <span class="table-item-content">{{
                      item.form_data.end_date || "--"
                    }}</span>
                  </div>
                  <div class="table-item">
                    <span class="table-item-title  history_justify_8">预计工期</span>
                    <span class="table-item-content">{{
                      item.form_data.expect_duration_days
                        ? item.form_data.expect_duration_days + "天"
                        : "--"
                    }}</span>
                  </div>
                  <div class="table-item" v-if="item.remark">
                    <span class="table-item-title  history_justify_8">备注描述</span>
                    <span class="table-item-content">{{ item.remark }}</span>
                  </div>
                </div>
              </template>
              <!-- 造价单 -->
              <template v-if="item.log_status == 220">
                <div class="content-table">
                  <div class="flex jb fw">
                    <div class="table-item" style="width: 50%">
                      <span class="table-item-title  history_justify_8">预计开工日期</span>
                      <span class="table-item-content">{{
                        item.form_data.start_date || "--"
                      }}</span>
                    </div>
                    <div class="table-item" style="width: 50%">
                      <span class="table-item-title  history_justify_8">预计完工日期</span>
                      <span class="table-item-content">{{
                        item.form_data.end_date || "--"
                      }}</span>
                    </div>
                    <div class="table-item" style="width: 50%">
                      <span class="table-item-title  history_justify_8">工期天数</span>
                      <span class="table-item-content">{{
                        item.form_data.duration_days
                          ? item.form_data.duration_days + "天"
                          : "--"
                      }}</span>
                    </div>
                    <div class="table-item" style="width: 50%">
                      <span class="table-item-title  history_justify_8">建筑面积</span>
                      <span class="table-item-content">{{
                        item.form_data.building_area
                          ? item.form_data.building_area + "m²"
                          : "--"
                      }}</span>
                    </div>
                    <div class="table-item" style="width: 50%">
                      <span class="table-item-title  history_justify_8">报价金额</span>
                      <span class="table-item-content">{{
                        item.form_data.quotation_amount
                          ? item.form_data.quotation_amount + "元"
                          : "--"
                      }}</span>
                    </div>
                    <div class="table-item" style="width: 50%" >
                      <span class="table-item-title  history_justify_8">基础装修费</span>
                      <span class="table-item-content">{{
                        item.form_data.basic_decoration_fee
                          ? item.form_data.basic_decoration_fee + "元"
                          : "--"
                      }}</span>
                    </div>
                    <div class="table-item" style="width: 50%" >
                      <span class="table-item-title  history_justify_8">主材采购费</span>
                      <span class="table-item-content">{{
                        item.form_data.material_costs
                          ? item.form_data.material_costs + "元"
                          : "--"
                      }}</span>
                    </div>
                    <div class="table-item" style="width: 50%">
                      <span class="table-item-title  history_justify_8">报价税金</span>
                      <span class="table-item-content">{{
                        item.form_data.quotation_taxes
                          ? item.form_data.quotation_taxes + "元"
                          : "--"
                      }}</span>
                    </div>
                    <div class="table-item" style="width: 50%" >
                      <span class="table-item-title  history_justify_8">成本金额</span>
                      <span class="table-item-content">{{
                        item.form_data.cost_amount
                          ? item.form_data.cost_amount + "元"
                          : "--"
                      }}</span>
                    </div>
                    <div class="table-item" style="width: 50%">
                      <span class="table-item-title  history_justify_8">现场采购成本</span>
                      <span class="table-item-content">{{
                        item.form_data.procurement_cost
                          ? item.form_data.procurement_cost + "元"
                          : "--"
                      }}</span>
                    </div>
                    <div class="table-item" style="width: 50%">
                      <span class="table-item-title  history_justify_8">公司集采成本</span>
                      <span class="table-item-content">
                        {{
                          item.form_data.centralized_procurement_cost
                            ? item.form_data.centralized_procurement_cost + "元"
                            : "--"
                        }}
                      </span>
                    </div>
                    <div class="table-item" style="width: 50%">
                      <span class="table-item-title  history_justify_8">管理成本</span>
                      <span class="table-item-content">{{
                        item.form_data.management_costs
                          ? item.form_data.management_costs + "元"
                          : "--"
                      }}</span>
                    </div>
                    <div class="table-item" style="width: 50%">
                      <span class="table-item-title  history_justify_8">利润金额</span>
                      <span class="table-item-content">{{
                        item.form_data.profit_amount
                          ? item.form_data.profit_amount + "元"
                          : "--"
                      }}</span>
                    </div>
                    <div class="table-item" style="width: 50%" >
                      <span class="table-item-title  history_justify_8">利润率(报价)</span>
                      <span class="table-item-content">{{
                        item.form_data.profit_ratio
                          ? item.form_data.profit_ratio + "%"
                          : "--"
                      }}</span>
                    </div>
                    <div class="table-item">
                      <span class="table-item-title  history_justify_8">报价类型</span>
                      <span class="table-item-content">
                        <template v-if="item.form_data.quotation_type == 1">基础施工报价（首次）</template>
                        <template v-if="item.form_data.quotation_type == 2">基础施工报价（调整）</template>
                        <template v-if="item.form_data.quotation_type == 3">增减项施工报价</template>
                      </span>
                    </div>
                    <div class="table-item" v-if="item.form_data.remark">
                      <span class="table-item-title  history_justify_8">备注描述</span>
                      <span class="table-item-content">{{
                        item.form_data.remark
                      }}</span>
                    </div>
                  </div>
                  <div class="table-item" v-if="
                    item.form_data.quotation_file.length
                  ">
                    <span class="table-item-title  history_justify_8">报价单文件</span>
                    <span @click="$fileViewHandle(item.form_data.quotation_file[0])" class="file-name">
                      {{ item.form_data.quotation_file[0].file_name }}
                    </span>
                  </div>
                  <div class="table-item" v-if="
                    item.form_data.profit_statement_file.length
                  ">
                    <span class="table-item-title  history_justify_8">利润单文件</span>
                    <span @click="
                      $fileViewHandle(item.form_data.profit_statement_file[0])
                      " class="file-name">
                      {{ item.form_data.profit_statement_file[0].file_name }}
                    </span>
                  </div>
                  <div class="table-item" v-if="
                    item.form_data.cost_list_file.length
                  ">
                    <span class="table-item-title  history_justify_8">成本单文件</span>
                    <span @click="$fileViewHandle(item.form_data.cost_list_file[0])" class="file-name">
                      {{ item.form_data.cost_list_file[0].file_name }}
                    </span>
                  </div>
                </div>
              </template>
              <!-- 只显示描述的 -->
              <!-- item.log_status == 440 || -->
              <template v-if="
                item.log_status == 130 ||
                item.log_status == 230 ||
                item.log_status == 240 ||
                item.log_status == 165 ||
                item.log_status == 160 ||
                item.log_status == 150 ||
                item.log_status == 210 ||
                item.log_status == 260 ||
                item.log_status == 270 ||
                item.log_status == 275 ||
                item.log_status == 300 ||
                item.log_status == 340 ||
                item.log_status == 330 ||
                item.log_status == 360 ||
                item.log_status == 370 ||
                item.log_status == 390 ||
                item.log_status == 400 ||
                item.log_status == 420 ||
                item.log_status == 415
              ">
                <div class="content-table" v-if="item.form_data.remark || item.form_data.reason_refusal">
                  <div class="table-item">
                    <span class="table-item-title  history_justify_8">备注</span>
                    <span class="table-item-content">{{
                      item.form_data.remark || item.form_data.reason_refusal
                    }}</span>
                  </div>
                </div>
              </template>
              <!-- 对客报价 -->
              <!-- <template v-if="item.log_status == 250">
                <div class="content-table">
                  <div class="table-item">
                    <span class="table-item-title  history_justify_8">报价金额</span>
                    <span class="table-item-content">{{
                      item.form_data.old_amount
                        ? item.form_data.old_amount + "元"
                        : "--"
                    }}</span>
                  </div>
                  <div class="table-item" >
                    <span class="table-item-title  history_justify_8">预计签约金额</span>
                    <span class="table-item-content">{{
                      item.form_data.new_amount
                        ? item.form_data.new_amount + "元"
                        : "--"
                    }}</span>
                  </div>
                  <div class="table-item">
                    <span class="table-item-title  history_justify_8">优惠金额</span>
                    <span class="table-item-content">{{
                      item.form_data.discount_amount
                        ? item.form_data.discount_amount + "元"
                        : "--"
                    }}</span>
                  </div>
                  <div class="table-item" v-if="item.form_data.remark">
                    <span class="table-item-title  history_justify_8">备注描述</span>
                    <span class="table-item-content">{{
                      item.form_data.remark
                    }}</span>
                  </div>
                </div>
              </template> -->
              <!-- 发起优惠审批 -->
              <template v-if="item.log_status == 255">
                <div class="content-table">
                  <div class="table-item" style="width: 50%">
                    <span class="table-item-title  history_justify_8">预算报价金额</span>
                    <span class="table-item-content">{{
                      item.form_data.budget_quotation_amount
                        ? item.form_data.budget_quotation_amount + "元"
                        : "--"
                    }}</span>
                  </div>
                  <div class="table-item" style="width: 50%">
                    <span class="table-item-title  history_justify_8">预计签约金额</span>
                    <span class="table-item-content">{{
                      item.form_data.expected_signing_amount
                        ? item.form_data.expected_signing_amount + "元"
                        : "--"
                    }}</span>
                  </div>
                  <div class="table-item" style="width: 50%" >
                    <span class="table-item-title  history_justify_8">优惠金额</span>
                    <span class="table-item-content">{{
                      item.form_data.discount_amount
                        ? item.form_data.discount_amount + "元"
                        : "--"
                    }}</span>
                  </div>
                  <div class="table-item" style="width: 50%" >
                    <span class="table-item-title  history_justify_8">优惠后利润金额</span>
                    <span class="table-item-content">{{
                      item.form_data.remaining_profit_amount
                        ? item.form_data.remaining_profit_amount + "元"
                        : "--"
                    }}</span>
                  </div>
                  <div class="table-item" style="width: 50%" >
                    <span class="table-item-title  history_justify_8">优惠后成本利润率</span>
                    <span class="table-item-content">{{
                      item.form_data.remaining_cost_profit_ratio
                        ? item.form_data.remaining_cost_profit_ratio + "%"
                        : "--"
                    }}</span>
                  </div>
                  <div class="table-item" style="width: 50%" >
                    <span class="table-item-title  history_justify_8">优惠前利润金额</span>
                    <span class="table-item-content">{{
                      item.form_data.profit_amount
                        ? item.form_data.profit_amount + "元"
                        : "--"
                    }}</span>
                  </div>
                  <div class="table-item" style="width: 50%">
                    <span class="table-item-title  history_justify_8">优惠前成本利润率</span>
                    <span class="table-item-content">{{
                      item.form_data.cost_profit_ratio
                        ? item.form_data.cost_profit_ratio + "%"
                        : "--"
                    }}</span>
                  </div>
                </div>
              </template>
              <!-- 合同信息 -->
              <template v-if="item.log_status == 280">
                <div class="content-table">
                  <div class="flex jb fw">
                    <div class="table-item" >
                      <span class="table-item-title  history_justify_8">签约主体</span>
                      <span class="table-item-content">{{
                        item.form_data.signing_company_name || "--"
                      }}</span>
                    </div>
                    <div class="table-item" style="width: 50%" >
                      <span class="table-item-title  history_justify_8">最终报价金额</span>
                      <span class="table-item-content">{{
                        item.form_data.quotation_amount
                          ? item.form_data.quotation_amount + "元"
                          : "--"
                      }}</span>
                    </div>
                    <div class="table-item" style="width: 50%" >
                      <span class="table-item-title  history_justify_8">合同签约金额</span>
                      <span class="table-item-content">{{
                        item.form_data.contract_price
                          ? item.form_data.contract_price + "元"
                          : "--"
                      }}</span>
                    </div>
                    <div class="table-item" style="width: 50%" >
                      <span class="table-item-title  history_justify_8">首期款</span>
                      <span class="table-item-content">
                        {{
                          item.form_data.down_payment
                            ? item.form_data.down_payment + "元"
                            : "--"
                        }}
                      </span>
                    </div>
                    <div class="table-item" style="width: 50%" >
                      <span class="table-item-title  history_justify_8">进度款</span>
                      <span class="table-item-content">
                        {{
                          item.form_data.progress_payment
                            ? item.form_data.progress_payment + "元"
                            : "--"
                        }}
                      </span>
                    </div>
                    <div class="table-item" style="width: 50%" >
                      <span class="table-item-title  history_justify_8">尾款</span>
                      <span class="table-item-content">
                        {{
                          item.form_data.balance_payment
                            ? item.form_data.balance_payment + "元"
                            : "--"
                        }}
                      </span>
                    </div>
                    <div class="table-item" style="width: 50%">
                      <span class="table-item-title  history_justify_8">合同开工日期</span>
                      <span class="table-item-content">
                        {{ item.form_data.contract_commencement_date || "--" }}
                      </span>
                    </div>
                    <div class="table-item" style="width: 50%" >
                      <span class="table-item-title  history_justify_8">合同完工日期</span>
                      <span class="table-item-content">{{
                        item.form_data.contract_completion_date || "--"
                      }}</span>
                    </div>
                    <div class="table-item" style="width: 50%" >
                      <span class="table-item-title  history_justify_8">合同工期</span>
                      <span class="table-item-content">{{
                        item.form_data.contract_duration_days
                          ? item.form_data.contract_duration_days + "天"
                          : "--"
                      }}</span>
                    </div>
                    <div class="table-item" style="width: 50%" >
                      <span class="table-item-title  history_justify_8">签约日期</span>
                      <span class="table-item-content">{{
                        item.form_data.signing_date || "--"
                      }}</span>
                    </div>
                  </div>
                  <div class="table-item" v-if="
                    item.form_data.contract_file.length
                  ">
                    <span class="table-item-title  history_justify_8">合同附件</span>
                    <span @click="$fileViewHandle(item.form_data.contract_file[0])" class="file-name">
                      {{ item.form_data.contract_file[0].file_name }}
                    </span>
                  </div>
                </div>
              </template>
              <!-- 预付款凭证 -->
              <template v-if="item.log_status == 290">
                <div class="content-table">
                  <div class="table-item">
                    <span class="table-item-title  history_justify_8">收款类型</span>
                    <span class="table-item-content">
                      <span>预付款费用</span>
                    </span>
                  </div>
                  <div class="table-item">
                    <span class="table-item-title  history_justify_8">收款账户</span>
                    <span class="table-item-content">{{
                      item.form_data.account_name || "--"
                    }}</span>
                  </div>
                  <div class="table-item">
                    <span class="table-item-title  history_justify_8">收款金额</span>
                    <span class="table-item-content">{{
                      item.form_data.amount_collected || "--"
                    }}</span>
                  </div>

                  <div class="table-item" v-if="item.remark">
                    <span class="table-item-title  history_justify_8">备注描述</span>
                    <span class="table-item-content">{{ item.remark }}</span>
                  </div>
                  <div class="table-item" v-if="
                    item.form_data.payment_voucher.length
                  ">
                    <span class="table-item-title  history_justify_8">收款凭证</span>
                  </div>
                  <div class="img-list-box flex ac fw">
                    <img @click="$fileViewHandle(file)" v-for="(file, fileIndex) in item.form_data
                      .payment_voucher" :key="fileIndex" class="img" :src="file.file_url" />
                  </div>
                </div>
              </template>
              <!-- 确认施工 -->
              <template v-if="item.log_status == 310">
                <div class="content-table">
                  <div class="flex jb fw">
                    <div class="table-item" style="width: 50%" >
                      <span class="table-item-title  history_justify_8">开工日期</span>
                      <span class="table-item-content">{{
                        item.form_data.start_date || "--"
                      }}</span>
                    </div>
                    <div class="table-item" style="width: 50%" >
                      <span class="table-item-title  history_justify_8 history_justify_4">工长</span>
                      <span class="table-item-content">{{
                        item.form_data.foreman_name || "--"
                      }}</span>
                    </div>
                    <div class="table-item" v-if="item.form_data.remark">
                      <span class="table-item-title  history_justify_8">备注描述</span>
                      <span class="table-item-content">{{
                        item.form_data.remark
                      }}</span>
                    </div>
                    <div class="table-item" v-if="
                      item.form_data.start_file.length 
                    ">
                      <span class="table-item-title  history_justify_8">开工图片</span>
                    </div>
                    <div class="img-list-box flex ac fw" v-if="
                      item.form_data.start_file.length 
                    ">
                      <img @click="$fileViewHandle(file)" v-for="(file, index) in item.form_data.start_file"
                        :key="index" class="img" :src="file.file_url" />
                    </div>
                  </div>
                </div>
              </template>
              <!-- 施工记录 -->
              <template v-if="item.log_status == 480">
                <div class="content-table">
                  <div class="flex jb fw">
                    <div class="table-item" style="width: 50%">
                      <span class="table-item-title  history_justify_8">施工进度</span>
                      <span class="table-item-content">
                        <template v-if="item.form_data.construction_progress == 10">待进场</template>
                        <template v-if="item.form_data.construction_progress == 20">施工中</template>
                        <template v-if="item.form_data.construction_progress == 30">一次预警</template>
                        <template v-if="item.form_data.construction_progress == 40">二次预警</template>
                        <template v-if="item.form_data.construction_progress == 50">已超期</template>
                        <template v-if="item.form_data.construction_progress == 60">停工中</template>
                        <template v-if="item.form_data.construction_progress == 70">已完工</template>
                      </span>
                    </div>
                    <div class="table-item" style="width: 50%" >
                      <span class="table-item-title  history_justify_8">是否超期</span>
                      <span class="table-item-content">{{
                        item.form_data.is_overdue == 1 ? "是" : "否"
                      }}</span>
                    </div>
                    <div class="table-item" v-if="
                      item.form_data.is_overdue == 1
                    ">
                      <span class="table-item-title  history_justify_8">超期类型</span>
                      <span>{{ item.form_data.overdue_type }}</span>
                    </div>
                    <div class="table-item" v-if="
                      item.form_data.is_overdue == 1
                    ">
                      <span class="table-item-title  history_justify_8">超期原因</span>
                      <span class="table-item-content">{{
                        item.form_data.reason_overdue || "--"
                      }}</span>
                    </div>
                    <div class="table-item" >
                      <span class="table-item-title  history_justify_8">施工阶段</span>
                      <span class="table-item-content">{{
                        item.form_data.construction_stage || "--"
                      }}</span>
                    </div>
                    <div class="table-item">
                      <span class="table-item-title  history_justify_8">施工内容</span>
                      <span class="table-item-content">{{
                        item.form_data.content || "--"
                      }}</span>
                    </div>
                    <div class="table-item" v-if="item.remark">
                      <span class="table-item-title  history_justify_8 history_justify_4">备注</span>
                      <span class="table-item-content">{{ item.remark }}</span>
                    </div>
                    <div class="table-item" v-if="
                      item.form_data.log_file.length
                    ">
                      <span class="table-item-title  history_justify_8">日志文件</span>
                      <span v-if="
                        item.form_data.log_file.length 
                      " @click="$fileViewHandle(item.form_data.log_file[0])" class="file-name">
                        {{ item.form_data.log_file[0].file_name }}
                      </span>
                    </div>
                  </div>
                </div>
              </template>
              <!-- 节点验收 -->
              <template v-if="item.log_status == 320">
                <div class="content-table">
                  <div class="table-item" v-for="(child, childIndex) in item.form_data.nodes" :key="childIndex">
                    <template v-if="child.name">
                      <span class="table-item-title  history_justify_8">{{ child.name }}</span>
                      <!-- 图片视频 -->
                      <template v-if="child.file.length">
                        <div class="img-list-box flex ac fw" style="margin-top: 10px">
                          <template v-for="(file, fileIndex) in child.file">
                            <div v-if="!isImageUrl(file.file_url)" class="img" @click="$fileViewHandle(file)"
                              :key="fileIndex">
                              <div class="play-icon">
                                <i class="el-icon-caret-right"></i>
                              </div>
                              <video :src="file.file_url"></video>
                            </div>
                            <img v-else @click="$fileViewHandle(file)" class="img" :src="file.file_url"
                              :key="fileIndex" />
                          </template>
                        </div>
                      </template>
                      <!-- 文字 -->
                      <template v-else>
                        <span class="table-item-content">{{
                          child.content || "--"
                        }}</span>
                      </template>
                    </template>
                  </div>
                  <div class="table-item" v-if="item.remark">
                    <span class="table-item-title  history_justify_8">备注</span>
                    <span class="table-item-content">{{
                      item.remark || "--"
                    }}</span>
                  </div>
                </div>
              </template>
              <!-- 节点进度款提交 -->
              <template v-if="item.log_status == 350">
                <div class="content-table">
                  <div class="table-item">
                    <span class="table-item-title  history_justify_8">收款类型</span>
                    <span class="table-item-content">
                      <span>进度款费用</span>
                    </span>
                  </div>
                  <div class="table-item">
                    <span class="table-item-title  history_justify_8">收款账户</span>
                    <span class="table-item-content">{{
                      item.form_data.account_name || "--"
                    }}</span>
                  </div>
                  <div class="table-item">
                    <span class="table-item-title  history_justify_8">收款金额</span>
                    <span class="table-item-content">{{
                      item.form_data.amount_collected || "--"
                    }}</span>
                  </div>

                  <div class="table-item" v-if="item.remark">
                    <span class="table-item-title  history_justify_8">备注描述</span>
                    <span class="table-item-content">{{ item.remark }}</span>
                  </div>
                  <div class="table-item" v-if="
                    item.form_data.payment_voucher.length 
                  ">
                    <span class="table-item-title  history_justify_8">收款凭证</span>
                  </div>
                  <div class="img-list-box flex ac fw" >
                    <img @click="$fileViewHandle(file)" v-for="(file, fileIndex) in item.form_data
                      .payment_voucher" :key="fileIndex" class="img" :src="file.file_url" />
                  </div>
                </div>
              </template>
              <!-- 结算单 -->
              <template v-if="item.log_status == 380">
                <div class="content-table">
                  <div class="flex jb fw">
                    <div class="table-item" style="width: 50%">
                      <span class="table-item-title  history_justify_8">合同签约金额</span>
                      <span class="table-item-content">{{
                        item.form_data.contract_price
                          ? item.form_data.contract_price + "元"
                          : "--"
                      }}</span>
                    </div>
                    <div class="table-item" style="width: 50%" >
                      <span class="table-item-title  history_justify_8">增减项总金额</span>
                      <span class="table-item-content">{{
                        item.form_data.changes_amount
                          ? item.form_data.changes_amount + "元"
                          : "--"
                      }}</span>
                    </div>
                    <div class="table-item" style="width: 50%">
                      <span class="table-item-title  history_justify_8">应结算金额</span>
                      <span class="table-item-content">{{
                        item.form_data.settlement_amount
                          ? item.form_data.settlement_amount + "元"
                          : "--"
                      }}</span>
                    </div>
                    <div class="table-item" style="width: 50%" >
                      <span class="table-item-title  history_justify_8">现场采购成本</span>
                      <span class="table-item-content">{{
                        item.form_data.procurement_cost
                          ? item.form_data.procurement_cost + "元"
                          : "--"
                      }}</span>
                    </div>
                    <div class="table-item" style="width: 50%" >
                      <span class="table-item-title  history_justify_8">公司集采成本</span>
                      <span class="table-item-content">
                        {{
                          item.form_data.centralized_procurement_cost
                            ? item.form_data.centralized_procurement_cost + "元"
                            : "--"
                        }}
                      </span>
                    </div>
                    <div class="table-item" style="width: 50%">
                      <span class="table-item-title  history_justify_8">管理成本</span>
                      <span class="table-item-content">{{
                        item.form_data.management_costs
                          ? item.form_data.management_costs + "元"
                          : "--"
                      }}</span>
                    </div>
                    <div class="table-item" style="width: 50%">
                      <span class="table-item-title  history_justify_8">利润金额</span>
                      <span class="table-item-content">{{
                        item.form_data.profit_amount
                          ? item.form_data.profit_amount + "元"
                          : "--"
                      }}</span>
                    </div>
                    <div class="table-item" style="width: 50%">
                      <span class="table-item-title  history_justify_8">已付款金额</span>
                      <span class="table-item-content">{{
                        item.form_data.paid_amount
                          ? item.form_data.paid_amount + "元"
                          : "--"
                      }}</span>
                    </div>
                    <div class="table-item" style="width: 50%">
                      <span class="table-item-title  history_justify_8">待付款金额</span>
                      <span class="table-item-content">{{
                        item.form_data.unpaid_amount
                          ? item.form_data.unpaid_amount + "元"
                          : "--"
                      }}</span>
                    </div>
                    <div class="table-item" style="width: 50%" >
                      <span class="table-item-title  history_justify_8">结算税金</span>
                      <span class="table-item-content">{{
                        item.form_data.settlement_taxes
                          ? item.form_data.settlement_taxes + "元"
                          : "--"
                      }}</span>
                    </div>
                    <div class="table-item" style="width: 50%">
                      <span class="table-item-title  history_justify_8">成本金额</span>
                      <span class="table-item-content">{{
                        item.form_data.settlement_cost_amount
                          ? item.form_data.settlement_cost_amount + "元"
                          : "--"
                      }}</span>
                    </div>
                    <div class="table-item" style="width: 50%">
                      <span class="table-item-title  history_justify_8">利润率</span>
                      <span class="table-item-content">{{
                        item.form_data.settlement_profit_margin
                          ? item.form_data.settlement_profit_margin + "%"
                          : "--"
                      }}</span>
                    </div>
                    <div class="table-item" v-if="
                      item.form_data.settlement_file.length
                    ">
                      <span class="table-item-title  history_justify_8">项目结算单</span>
                      <span @click="
                        $fileViewHandle(item.form_data.settlement_file[0])
                        " class="file-name">
                        {{ item.form_data.settlement_file[0].file_name }}
                      </span>
                    </div>
                    <div class="table-item" v-if="
                      item.form_data.inventory_file.length
                    ">
                      <span class="table-item-title  history_justify_8">工程量清单</span>
                      <span @click="
                        $fileViewHandle(item.form_data.inventory_file[0])
                        " class="file-name">
                        {{ item.form_data.inventory_file[0].file_name }}
                      </span>
                    </div>
                    <div class="table-item" v-if="
                      item.form_data.profit_statement_file.length
                    ">
                      <span class="table-item-title  history_justify_8">利润单</span>
                      <span @click="
                        $fileViewHandle(
                          item.form_data.profit_statement_file[0]
                        )
                        " class="file-name">
                        {{ item.form_data.profit_statement_file[0].file_name }}
                      </span>
                    </div>
                  </div>
                  <div class="table-item" v-if="item.remark ">
                    <span class="table-item-title  history_justify_8">备注</span>
                    <span class="table-item-content">{{ item.remark }}</span>
                  </div>
                </div>
              </template>
              <!-- 尾款凭证 -->
              <template v-if="item.log_status == 410">
                <div class="content-table">
                  <div class="table-item" >
                    <span class="table-item-title  history_justify_8">收款类型</span>
                    <span class="table-item-content">
                      <span>尾款</span>
                    </span>
                  </div>
                  <div class="table-item">
                    <span class="table-item-title  history_justify_8">收款账户</span>
                    <span class="table-item-content">{{
                      item.form_data.account_name || "--"
                    }}</span>
                  </div>
                  <div class="table-item">
                    <span class="table-item-title  history_justify_8">收款金额</span>
                    <span class="table-item-content">{{
                      item.form_data.amount_collected?item.form_data.amount_collected+'元':'--'
                    }}</span>
                  </div>

                  <div class="table-item" v-if="item.remark">
                    <span class="table-item-title  history_justify_8">备注描述</span>
                    <span class="table-item-content">{{ item.remark }}</span>
                  </div>
                  <div class="table-item" v-if="
                    item.form_data.payment_voucher.length 
                  ">
                    <span class="table-item-title  history_justify_8">收款凭证</span>
                  </div>
                  <div class="img-list-box flex ac fw" >
                    <img @click="$fileViewHandle(file)" v-for="(file, fileIndex) in item.form_data
                      .payment_voucher" :key="fileIndex" class="img" :src="file.file_url" />
                  </div>
                </div>
              </template>
              <!-- 用户评价 -->
              <template v-if="item.log_status == 430">
                <div class="content-table">
                  <div class="table-item">
                    <span class="table-item-title  history_justify_8 width100">工程质量满意度</span>
                    <span class="table-item-content">
                      <el-rate disabled v-model="item.form_data.construction_quality"
                        disabledtext-color="#ff9900"></el-rate>
                    </span>
                  </div>
                  <div class="table-item">
                    <span class="table-item-title  history_justify_8 width100">工程服务满意度</span>
                    <span class="table-item-content">
                      <el-rate disabled v-model="item.form_data.engineering_services"
                        disabledtext-color="#ff9900"></el-rate>
                    </span>
                  </div>
                  <div class="table-item">
                    <span class="table-item-title  history_justify_8 width100">监理响应满意度</span>
                    <span class="table-item-content">
                      <el-rate disabled v-model="item.form_data.supervision_response"
                        disabledtext-color="#ff9900"></el-rate>
                    </span>
                  </div>
                  <div class="table-item">
                    <span class="table-item-title  history_justify_8 width100">向他人推荐评分</span>
                    <span class="table-item-content">
                      <el-rate disabled v-model="item.form_data.recommendation" disabledtext-color="#ff9900"></el-rate>
                    </span>
                  </div>
                  <div class="table-item">
                    <span class="table-item-title  history_justify_8 width100">客户经理服务态度</span>
                    <span class="table-item-content">
                      <el-rate disabled v-model="item.form_data.service_attitude"
                        disabledtext-color="#ff9900"></el-rate>
                    </span>
                  </div>
                  <div class="table-item">
                    <span class="table-item-title  history_justify_8 width100">客户经理回复速度</span>
                    <span class="table-item-content">
                      <el-rate disabled v-model="item.form_data.reply_speed" disabledtext-color="#ff9900"></el-rate>
                    </span>
                  </div>
                  <div class="table-item">
                    <span class="table-item-title  history_justify_8 width100">客户经理讲解能力</span>
                    <span class="table-item-content">
                      <el-rate disabled v-model="item.form_data.explanatory_ability"
                        disabledtext-color="#ff9900"></el-rate>
                    </span>
                  </div>
                </div>
              </template>
              <!-- 项目取消 -->
              <template v-if="item.log_status == 460">
                <div class="content-table">
                  <div class="flex jb fw" style="width: 50%;">
                    <div class="table-item">
                      <span class="table-item-title  history_justify_8">取消类型</span>
                      <span class="table-item-content">
                        <template v-if="item.form_data.cancel_type == 1">价格原因</template>
                        <template v-if="item.form_data.cancel_type == 2">工期原因</template>
                        <template v-if="item.form_data.cancel_type == 3">客户拒绝沟通</template>
                        <template v-if="item.form_data.cancel_type == 4">客户自行施工</template>
                        <template v-if="item.form_data.cancel_type == 5">不可抗力因素</template>
                        <template v-if="item.form_data.cancel_type == 6">前施工问题影响</template>
                        <template v-if="item.form_data.cancel_type == 7">客户关联</template>
                        <template v-if="item.form_data.cancel_type == 8">其他原因</template>
                      </span>
                    </div>
                  </div>
                  <div class="flex jb fw" style="width: 50%;">
                    <div class="table-item">
                      <span class="table-item-title  history_justify_8">取消原因</span>
                      <span class="table-item-content">{{
                        item.form_data.remark
                      }}</span>
                    </div>
                  </div>
                  <div class="table-item" v-if="item.form_data.cancel_file.length">
                    <span class="table-item-title  history_justify_8">取消附件</span>
                    <span @click="$fileViewHandle(item.form_data.cancel_file[0])"
                      class="file-name">
                      {{ item.form_data.cancel_file[0].file_name }}
                    </span>
                  </div>
                </div>
              </template>
              <!-- 提交增项款信息 -->
              <template v-if="item.log_status == 490">
                <div class="content-table">
                  <div class="table-item" >
                    <span class="table-item-title  history_justify_8">收款类型</span>
                    <span class="table-item-content">
                      <span>增项款费用</span>
                    </span>
                  </div>
                  <div class="table-item" >
                    <span class="table-item-title  history_justify_8">收款账户</span>
                    <span class="table-item-content">{{
                      item.form_data.account_name || "--"
                    }}</span>
                  </div>
                  <div class="table-item" >
                    <span class="table-item-title  history_justify_8">收款金额</span>
                    <span class="table-item-content">{{
                      item.form_data.amount_collected || "--"
                    }}</span>
                  </div>

                  <div class="table-item" v-if="item.remark">
                    <span class="table-item-title  history_justify_8">备注描述</span>
                    <span class="table-item-content">{{ item.remark }}</span>
                  </div>
                  <div class="table-item" v-if="
                    item.form_data.payment_voucher 
                  ">
                    <span class="table-item-title  history_justify_8">收款凭证</span>
                  </div>
                  <div class="img-list-box flex ac fw" >
                    <img @click="$fileViewHandle(file)" v-for="(file, fileIndex) in item.form_data
                      .payment_voucher" :key="fileIndex" class="img" :src="file.file_url" />
                  </div>
                </div>
              </template>
              <!-- 提交定金信息 -->
              <template v-if="item.log_status == 510">
                <div class="content-table">
                  <div class="table-item" >
                    <span class="table-item-title  history_justify_8">收款类型</span>
                    <span class="table-item-content">
                      <span>定金费用</span>
                    </span>
                  </div>
                  <div class="table-item">
                    <span class="table-item-title  history_justify_8">收款账户</span>
                    <span class="table-item-content">{{
                      item.form_data.account_name || "--"
                    }}</span>
                  </div>
                  <div class="table-item" >
                    <span class="table-item-title  history_justify_8">收款金额</span>
                    <span class="table-item-content">{{
                      item.form_data.amount_collected || "--"
                    }}</span>
                  </div>

                  <div class="table-item" v-if="item.remark">
                    <span class="table-item-title  history_justify_8">备注描述</span>
                    <span class="table-item-content">{{ item.remark }}</span>
                  </div>
                  <div class="table-item" v-if="
                    item.form_data.payment_voucher.length 
                  ">
                    <span class="table-item-title  history_justify_8">收款凭证</span>
                  </div>
                  <div class="img-list-box flex ac fw" >
                    <img @click="$fileViewHandle(file)" v-for="(file, fileIndex) in item.form_data
                      .payment_voucher" :key="fileIndex" class="img" :src="file.file_url" />
                  </div>
                </div>
              </template>
            </div>
          </div>
        </el-timeline-item>
      </el-timeline>
    </div>
  </el-drawer>
</template>
<script>
import companyApi from "@/api/companyApi";
export default {
  name: "",
  props: {
    fieldList: {
      default: {},
      required: false,
    },
    addDialogVisible: {
      type: Boolean,
      default: false,
      required: false,
    },
    logLoaidng: {
      type: Boolean,
      default: false,
      required: false,
    },
    log_list: {
      type: Array,
      default: [],
      required: false,
    },
    activeName: {
      type: String,
      default: "0",
      required: false,
    },
  },
  data() {
    return {
      logList: [],
      hisDrawer: false,
      tabList: [
        {
          label: "全部",
          id: "0",
        },
        {
          label: "勘场记录",
          id: "1",
        },
        {
          label: "报价记录",
          id: "2",
        },
        {
          label: "合同记录",
          id: "3",
        },
        {
          label: "施工记录",
          id: "4",
        },
        // {
        //   label: "施工日志",
        //   id: '6'
        // },
        {
          label: "收尾记录",
          id: "5",
        },
      ],
    };
  },
  watch: {
    addDialogVisible(val1, val2) {
      this.hisDrawer = this.addDialogVisible;
      if (this.addDialogVisible) {
        this.logList = this.log_list;
      }
    },
    log_list() {
      if (this.hisDrawer) {
        this.logList = this.log_list;
      }
    },
  },
  computed: {},
  mounted() { },
  methods: {
    tabClick(e) {
      let tabList = this.tabList;
      this.$emit("tabClick", tabList[Number(e.index)].id);
    },
    close() {
      this.$emit("close", true);
    },
    // 是否图片
    isImageUrl(url) {
      const imageExtensions = ["jpg", "png", "gif", "jpeg", "webp", "bmp"];
      const parsedUrl = new URL(url);
      const path = parsedUrl.pathname.toLowerCase();
      const ext = path.substring(path.lastIndexOf(".") + 1);
      return imageExtensions.includes(ext);
    },
    // 收款账户列表(丢弃)
    getCompanyList(account_type) {
      let logList = this.logList;
      companyApi
        .getCompanyList({
          page: 1,
          num: 9999,
          keyword: "",
          account_type,
        })
        .then((res) => {
          console.log(res, "收款账户");
          if (res.code == 200) {

            logList.splice(0, 0);
            this.logList = logList;
          }
        })
        .catch((err) => { });
    },
  },
};
</script>
<style lang="scss" scoped>
@import "./index.scss";
</style>
